<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="jquery-3.6.0.js"></script>
		<style>
			.con>.fish{
				position: absolute;
			}
			.con{
				position: relative;
			}
		</style>
	</head>
	<body>
		<button>开始</button>
		<button>停止</button>
		<div class="con">
			<div class="fish"><img src="fish.jpg" width="100px"></div>
		</div>
		<script>
			$("button").eq(0).click(function(){
				$(".con>.fish").animate({"left":"200px"},2000)
				.animate({"top":"200px"},2000)
				.animate({"left":"0px"},2000)
				.animate({"top":"0px"},2000)
			});
			$("button").eq(1).click(function(){
				$(".con>.fish").stop(true,false);
			});
		</script>
	</body>
</html>
